class RouteType{
    constructor(){}

    getElement(){

    }
}

class HomeRouteType extends RouteType{
    constructor(){
        super()
    }

    getElement(){

    }
}

class CreateSurveyRouteType extends RouteType{
    constructor(){
        super()
    }

    getElement(){

    }
}

class ManageSurveyRouteType extends RouteType{
    constructor(){
        super()
    }

    getElement(){

    }
}

 class Router{
    constructor(){
        this.homeRoute = new HomeRouteType()
        this.createSurveyRoute = new CreateSurveyRouteType()
        this.manageSurveyRoute = new ManageSurveyRouteType()

        this.route = this.homeRoute
    }

    getElement(){
        return this.route.getElement()
    }

    routeHome(){
        this.route = this.homeRoute
    }
    routeCreateSurvey(){
        this.route = this.createSurveyRoute
    }
    routeManageSurvey(){
        this.route = this.manageSurveyRoute
    }
}

let router;
export default function getRouter() {
    if(!router){
        console.log('创建一次')
        router = new Router()
    }
    return router
}
